import { userControllerGetUserInfo } from "@/app/servers/api/user";
import { cookies, headers } from "next/headers";
import Conservation from "./conservation";
import { promptControllerFindAll } from "@/app/servers/api/prompt";

export default async function ConservationPage() {
  const { data: userinfo } = await userControllerGetUserInfo({
    next: {
      cookies: cookies(),
      headers: headers(),
    },
  });
  const { data: promptTextList } = await promptControllerFindAll();
  return (
    <Conservation
      userInfo={userinfo}
      promptTextList={promptTextList.map((el) => el.title)}
    />
  );
}
